#ifndef CTerrainMesh_____
#define CTerrainMesh_____

#include "Vector3f.h"
#include "Heightmap.h"
#include "Array2D.h"
#include <vector>
using namespace std;

class CTerrainMesh
{
  public:

	//-------------------------------------------------------------------------
	// members
	//-------------------------------------------------------------------------

	vector< vector< vector3f > > m_vVertexCoords;
	vector< vector< vector3f > > m_vVertexNormals;
	CArray2D *m_fTStripVertices;
	CArray2D *m_fTStripNormals;
	unsigned int m_nRows, m_nCols, m_nVerticesPerStrip;
	float m_fMinHeight, m_fMaxHeight, m_fMeshSpacing;

	//-------------------------------------------------------------------------
	// constructors
	//-------------------------------------------------------------------------

	CTerrainMesh();

	//-------------------------------------------------------------------------
	// destructor
	//-------------------------------------------------------------------------

	~CTerrainMesh();

	//-------------------------------------------------------------------------
	// overloaded operators
	//-------------------------------------------------------------------------

	//-------------------------------------------------------------------------
	// functions
	//-------------------------------------------------------------------------

	void CreateMesh(CHeightmap &hmap);
	void DrawMesh();
	void AdjustMesh(float fMaxMeshHeight, float fMeshSpacing);

	void ComputeNormals();
	void DrawNormals();
	void CreateTStrips();

};

#endif